[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Function            depreciation - calculate depreciation for a
                                       period

  Syntax              double depreciation(double cost, double salvage,
                                          int life, int period, int
                                          dtype);

  Prototype in        finance.h

  Remarks             given the cost, salvage value and life of an item,
                      depreciation will calculate the amount of
                      deprecitation for the given period according to the
                      depreciation method specified by dtype. The cost
                      and salvage can be given in any unit (dollars,
                      thousands of dollars, etc.) but the life should be
                      given in depreciable periods (if you depreciate an
                      item every quarter, and the item has a life of 2
                      years, then life should be 8).

                      The cost and salvage values should be in the same
                      units. The life and period should be given in the
                      same units.

                      Types of depreciation supported by the variable
                      dtype are:

                           1 -  Straight line depreciation
                           2 -  Sum of the years digits depreciation
                           3 -  Double declining balance depreciation

                      Any other value for dtype will produce
                      unpredictable results.

                      No error checking is performed.

                      This is a generic function to calculate the
                      depreciation given all necessary information. Any
                      unnecessary information is ignored (i.e. straight
                      line depreciation does not need a period.)

  Return value        returns the amount of depreciation for the given
                      period in the same units as the cost, as per the
                      depreciation method specified by dtype.

  See also            accum_dep(), double_decline_bal_dep(),
                      straight_line_dep(), sum_year_digits_dep()

  Example             see demonum.c

See Also: accum_dep() double_decline_bal_dep() straight_line_dep()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson